<?php

namespace ServiceBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Area
 *
 * @ORM\Table(name="area", options={"comment":"省市区表"})
 * @ORM\Entity()
 */
class Area
{
    /**
     * @var string
     *
     * @ORM\Column(name="id", type="string", length=10, options={"comment":"省市区编号"})
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="NONE")
     */
    private $id;

    /**
     * @var \ServiceBundle\Entity\Area
     *
     * @ORM\ManyToOne(targetEntity="ServiceBundle\Entity\Area")
     * @ORM\JoinColumn(name="parent_id", referencedColumnName="id")
     */
    private $parent;

    /**
     * @var string
     *
     * @ORM\Column(name="name", type="string", length=45, options={"comment":"区域名称"})
     */
    private $name;

    /**
     * @var string
     *
     * @ORM\Column(name="first_letter", type="string", nullable=true, length=1, options={"fixed":true, "comment":"区域名称首字母"})
     */
    private $firstLetter;

    /**
     * Set id
     *
     * @param string $id
     *
     * @return Area
     */
    public function setId($id)
    {
        $this->id = $id;

        return $this;
    }

    /**
     * Get id
     *
     * @return string
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set name
     *
     * @param string $name
     *
     * @return Area
     */
    public function setName($name)
    {
        $this->name = $name;

        return $this;
    }

    /**
     * Get name
     *
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Set firstLetter
     *
     * @param string $firstLetter
     *
     * @return Area
     */
    public function setFirstLetter($firstLetter)
    {
        $this->firstLetter = $firstLetter;

        return $this;
    }

    /**
     * Get firstLetter
     *
     * @return string
     */
    public function getFirstLetter()
    {
        return $this->firstLetter;
    }

    /**
     * Set parent
     *
     * @param \ServiceBundle\Entity\Area $parent
     *
     * @return Area
     */
    public function setParent(\ServiceBundle\Entity\Area $parent = null)
    {
        $this->parent = $parent;

        return $this;
    }

    /**
     * Get parent
     *
     * @return \ServiceBundle\Entity\Area
     */
    public function getParent()
    {
        return $this->parent;
    }
}
